home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / debhelper / autoscripts / prerm-pycentral < prev    next >
Encoding:
Text File  |  2007-04-10  |  721 b   |  25 lines

  1. if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
  2.     pycentral pkgremove #PACKAGE#
  3. else
  4.     flist=$(tempfile)
  5.     find /usr/share/pycentral/#PACKAGE# -depth -mindepth 2 \
  6.       \( -name '*.py' -printf 'p %P\n' -o -printf '%y %P\n' \) \
  7.       > $flist 2>/dev/null || true
  8.     if [ -s $flist ]; then
  9.         for d in /usr/lib/python[0-9].[0-9]; do
  10.         case "$d" in */python2.1|*/python2.2) continue; esac
  11.         while read t n; do
  12.             case "$t" in
  13.             p) rm -f $d/$n $d/${n}[co];;
  14.             d) rmdir $d/$n 2>/dev/null || true;;
  15.             *) rm -f $d/$n
  16.             esac
  17.         done < $flist
  18.         done
  19.     fi
  20.     rm -f $flist
  21.     dpkg -L #PACKAGE# \
  22.             | awk '/\/usr\/share\/pycentral/ {next} /\.py$/ {print $0"c\n" $0"o"}' \
  23.         | xargs rm -f >&2
  24. fi
  25.